from django.db import models
from django.contrib.auth.models import User

class Financier(models.Model):
    financier = models.OneToOneField(User)

    @staticmethod
    def is_financier(user):
        try:
            Financier.objects.get(financier=user)
            is_financier = 1
        except(Financier.DoesNotExist):
            is_financier = 0
            
        return is_financier
        
    
    def __unicode__(self):
        return u'%s' % (self.financier)
